package com.study.dao;

import com.study.dao.impl.AdminInfoDAOImpl;
import com.study.dao.impl.AthletesInfoDAOImpl;
import com.study.dto.AthletesDto;
import com.study.pojo.AdminInfo;
import com.study.pojo.AthletesInfo;
import org.junit.jupiter.api.Test;

import java.sql.SQLException;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.List;

/**
 * @PackgeName: com.study.dao
 * @ClassName: AdminInfoTest
 * @Author: 严志祥
 * Date: 2022-05-04 20:31
 * project name: web_project_medal
 * @Version:
 * @Description:
 */
public class AthletesInfoTest {
    SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
    AthletesInfoDAO ad = new AthletesInfoDAOImpl();

    @Test
    public void delete() throws SQLException {
        ad.deleteById(1);
    }

    @Test
    public void selectById() throws SQLException {
        AthletesInfo athletesInfo = ad.selectById(10);
        System.out.println(athletesInfo);
    }


    @Test
    public void count() throws SQLException {
        long count = ad.count();
        System.out.println(count);
    }

    @Test
    public void test3() throws SQLException {
        List<AthletesDto> list = ad.selectAthletes("谷爱凌");
        list.forEach(item->{
            System.out.println(item.getAthletesSex());
            System.out.println(item.getAthletesName());
            System.out.println(item.getSportingName());
        });
    }
}
